\(\int \frac {A+B x}{a+c x^2} \, dx\) [1334]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 42 \[ \int \frac {A+B x}{a+c x^2} \, dx=\frac {A \arctan \left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {c}}+\frac {B \log \left (a+c x^2\right )}{2 c} \]

[Out]

1/2*B*ln(c*x^2+a)/c+A*arctan(x*c^(1/2)/a^(1/2))/a^(1/2)/c^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {649, 211, 266} \[ \int \frac {A+B x}{a+c x^2} \, dx=\frac {A \arctan \left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {c}}+\frac {B \log \left (a+c x^2\right )}{2 c} \]

[In]

Int[(A + B*x)/(a + c*x^2),x]

[Out]

(A*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*Sqrt[c]) + (B*Log[a + c*x^2])/(2*c)

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 649

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[(-a)*c]

Rubi steps \begin{align*} \text {integral}& = A \int \frac {1}{a+c x^2} \, dx+B \int \frac {x}{a+c x^2} \, dx \\ & = \frac {A \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {c}}+\frac {B \log \left (a+c x^2\right )}{2 c} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.00 \[ \int \frac {A+B x}{a+c x^2} \, dx=\frac {A \arctan \left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {c}}+\frac {B \log \left (a+c x^2\right )}{2 c} \]

[In]

Integrate[(A + B*x)/(a + c*x^2),x]

[Out]

(A*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*Sqrt[c]) + (B*Log[a + c*x^2])/(2*c)

Maple [A] (verified)

Time = 0.27 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.76

method result size
default \(\frac {B \ln \left (c \,x^{2}+a \right )}{2 c}+\frac {A \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}}\) \(32\)
risch \(\frac {\ln \left (-\sqrt {-a c}\, x +a \right ) A \sqrt {-a c}}{2 a c}+\frac {\ln \left (-\sqrt {-a c}\, x +a \right ) B}{2 c}-\frac {\ln \left (\sqrt {-a c}\, x +a \right ) A \sqrt {-a c}}{2 a c}+\frac {\ln \left (\sqrt {-a c}\, x +a \right ) B}{2 c}\) \(90\)

[In]

int((B*x+A)/(c*x^2+a),x,method=_RETURNVERBOSE)

[Out]

1/2*B*ln(c*x^2+a)/c+A/(a*c)^(1/2)*arctan(c*x/(a*c)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 98, normalized size of antiderivative = 2.33 \[ \int \frac {A+B x}{a+c x^2} \, dx=\left [\frac {B a \log \left (c x^{2} + a\right ) - \sqrt {-a c} A \log \left (\frac {c x^{2} - 2 \, \sqrt {-a c} x - a}{c x^{2} + a}\right )}{2 \, a c}, \frac {B a \log \left (c x^{2} + a\right ) + 2 \, \sqrt {a c} A \arctan \left (\frac {\sqrt {a c} x}{a}\right )}{2 \, a c}\right ] \]

[In]

integrate((B*x+A)/(c*x^2+a),x, algorithm="fricas")

[Out]

[1/2*(B*a*log(c*x^2 + a) - sqrt(-a*c)*A*log((c*x^2 - 2*sqrt(-a*c)*x - a)/(c*x^2 + a)))/(a*c), 1/2*(B*a*log(c*x
^2 + a) + 2*sqrt(a*c)*A*arctan(sqrt(a*c)*x/a))/(a*c)]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 124 vs. \(2 (37) = 74\).

Time = 0.12 (sec) , antiderivative size = 124, normalized size of antiderivative = 2.95 \[ \int \frac {A+B x}{a+c x^2} \, dx=\left (- \frac {A \sqrt {- a c^{3}}}{2 a c^{2}} + \frac {B}{2 c}\right ) \log {\left (x + \frac {- B a + 2 a c \left (- \frac {A \sqrt {- a c^{3}}}{2 a c^{2}} + \frac {B}{2 c}\right )}{A c} \right )} + \left (\frac {A \sqrt {- a c^{3}}}{2 a c^{2}} + \frac {B}{2 c}\right ) \log {\left (x + \frac {- B a + 2 a c \left (\frac {A \sqrt {- a c^{3}}}{2 a c^{2}} + \frac {B}{2 c}\right )}{A c} \right )} \]

[In]

integrate((B*x+A)/(c*x**2+a),x)

[Out]

(-A*sqrt(-a*c**3)/(2*a*c**2) + B/(2*c))*log(x + (-B*a + 2*a*c*(-A*sqrt(-a*c**3)/(2*a*c**2) + B/(2*c)))/(A*c))
+ (A*sqrt(-a*c**3)/(2*a*c**2) + B/(2*c))*log(x + (-B*a + 2*a*c*(A*sqrt(-a*c**3)/(2*a*c**2) + B/(2*c)))/(A*c))

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.74 \[ \int \frac {A+B x}{a+c x^2} \, dx=\frac {A \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}} + \frac {B \log \left (c x^{2} + a\right )}{2 \, c} \]

[In]

integrate((B*x+A)/(c*x^2+a),x, algorithm="maxima")

[Out]

A*arctan(c*x/sqrt(a*c))/sqrt(a*c) + 1/2*B*log(c*x^2 + a)/c

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.74 \[ \int \frac {A+B x}{a+c x^2} \, dx=\frac {A \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}} + \frac {B \log \left (c x^{2} + a\right )}{2 \, c} \]

[In]

integrate((B*x+A)/(c*x^2+a),x, algorithm="giac")

[Out]

A*arctan(c*x/sqrt(a*c))/sqrt(a*c) + 1/2*B*log(c*x^2 + a)/c

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.76 \[ \int \frac {A+B x}{a+c x^2} \, dx=\frac {B\,\ln \left (c\,x^2+a\right )}{2\,c}+\frac {A\,\mathrm {atan}\left (\frac {\sqrt {c}\,x}{\sqrt {a}}\right )}{\sqrt {a}\,\sqrt {c}} \]

[In]

int((A + B*x)/(a + c*x^2),x)

[Out]

(B*log(a + c*x^2))/(2*c) + (A*atan((c^(1/2)*x)/a^(1/2)))/(a^(1/2)*c^(1/2))